<template>
  <div class='container-title'>
    <van-nav-bar :title="titleName" :left-arrow="arrow" @click-left="toRouter" />
  </div>
</template>

<script>
export default {
  props: {
    routerName: {
      type: String
    },
    moreText: {
      type: String
    },
    arrow: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {

    }
  },
  computed: {
    titleName() {
      return this.$route.meta.title || ''
    }
  },
  created() {
  },
  methods: {
    toRouter() {
      if (this.routerName) {
        this.$router.push({
          path: this.routerName,
          query: {
            type: this.$route.query.type || 0
          }
        })
      } else {
        this.$router.go(-1)
      }

    }
  },

}
</script>

<style scoped lang="less">
.container-title {
  width: 100%;

  /deep/ .van-nav-bar {
    background: #3975C6;

    .van-icon {
      color: #F5F7FA;
    }

    .van-nav-bar__title {
      color: #F5F7FA;
    }

    ::after {
      content: '';
      position: inherit;
      border: none;
    }
  }

  /deep/ .van-hairline--bottom::after {
    content: '';
    border: none;
  }

}
</style>